let s = 'hello';
let n: typeof s; // let n: string

type Predicate = (x: unknown) => boolean;
// type K = boolean
type K = ReturnType<Predicate>;

function f() {
    return { x: 10, y: 3 };
}

// 'f' refers to a value, but is being used as a type here. Did you mean 'typeof f'?
// type P = ReturnType<f>;

type P = ReturnType<typeof f>;
// type P = {
//     x: number;
//     y: number;
// }
